package com.ac.api.base.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ac.api.base.entity.SysMessage;
import com.ac.api.base.vo.SysMessageVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author mzl
 * @since 2020-11-14
 */
public interface SysMessageMapper extends BaseMapper<SysMessage> {

    /**
     * 条件查询
     *
     * @param queryWrapper
     * @return
     */
    List<SysMessageVo> findByExample(@Param(Constants.WRAPPER) QueryWrapper<SysMessageVo> queryWrapper);

    /**
     * 条件查询
     *
     * @param page
     * @param queryWrapper
     * @return
     */
    List<SysMessageVo> findByExample(@Param(Constants.WRAPPER) QueryWrapper<SysMessageVo> queryWrapper, Page page);

    /**
     * 根据id获取详情
     *
     * @param id
     * @return
     */
    SysMessageVo findById(@Param("id") final Integer id);

    /**
     * 订单未读记录
     *
     * @param userid
     * @return
     */
    Integer userUnReadCount(@Param("userid") Integer userid);

}
